<link rel="stylesheet" type="text/css" href="../addons/jy_h5game/resource/xianchang/css/basic.css">	
<link rel="stylesheet" href="../addons/jy_h5game/resource/xianchang/css/screen_lottery_nfree6.css" type="text/css">
<link rel="stylesheet" href="../addons/jy_h5game/resource/xianchang/css/spinners.css" type="text/css">
<script src="../addons/jy_h5game/resource/xianchang/js/tool.js" type="text/javascript" charset="utf-8"></script>
<div class="">
<div class="table-box" style="margin-left:0">
            <div class="table">         
                <img class="seat-img2" src="../addons/jy_h5game/resource/xianchang/images/xysjh/seat-img2.png">
                <img class="seat-img3" src="../addons/jy_h5game/resource/xianchang/images/xysjh/seat-img3.png">
                 <img class="seat-img4" src="../addons/jy_h5game/resource/xianchang/images/xysjh/seat-img4.png">
                <img class="seat-img1" src="../addons/jy_h5game/resource/xianchang/images/xysjh/seat-img3.png">               
                <span class="table-num" id="jqDeskText" >0</span>
                <div id="jqAddDeskAni" class="table-move">
                    <span id="jqDeskText1" class="table-move1">0</span>
                </div>
                <div class="table-button">
                    <div class="table-btn">
                        <p>抽奖数量：</p>
                        <select ng-model="pagedata.item.num"  id="sltAwardNum" >
                            <option  value="-1" selected="selected" style="display: none;">请选择</option>
													<option  value="1">1</option>
													<option value="2">2</option>
													<option value="3">3</option>
													<option value="4">4</option>
													<option value="5">5</option>
													<option value="6">6</option>
													<option value="7">7</option>
													<option value="8">8</option>
													<option value="9">9</option>
													<option value="10">10</option>
													<option value="11">11</option>
													<option value="12">12</option>
													<option value="13">13</option>
													<option value="14">14</option>
													<option value="15">15</option>
													<option value="16">16</option>
													<option value="17">17</option>
													<option value="18">18</option>
													<option value="19">19</option>
													<option value="20">20</option>
													<option value="30">30</option>
													<option value="40">40</option>
													<option value="50">50</option>
													<option value="60">60</option>
													<option value="70">70</option>
													<option value="80">80</option>
													<option value="90">90</option>
													<option value="100">100</option>
													<option value="200">200</option>
                        </select>
                    </div>
                    <button id="jqStart" ng-click="pagedata.cj()" >开始抽奖</button>
                    <button id="jqEnd"  ng-click="pagedata.end()" class="hide">停止抽奖</button>
                    <div class="clear"></div>
                </div>
            </div>
			
            <div class="table-win">
				<div style="text-align:center;margin-top:-36px;color:rgb(255, 232, 36);font-size:15px">总参与人数：{{pagedata.item.sjh_num}}人</div>
                <ul class="table-list" id="jqResultBox" >
                </ul>
            </div>
        </div> 
</div>
<link rel="stylesheet" type="text/css" href="../addons/jy_h5game/resource/xianchang/css/footer.css">
   <style>
	body {background: url(../addons/jy_h5game/resource/xianchang/style/all/035d.jpg) #000;background-size: cover;}
   </style>
<script type="text/javascript">
scope.pagedata.getsjh_num = function(){
	scope.get('jy_h5game/get_data/sjh_num',function(res){
		scope.pagedata.item.sjh_num=res.num
	})
}
scope.pagedata.getsjh_num();
scope.pagedata.init = function(i){
    if(!i){i=0}
	if(i>300){
		return;
		}
	setTimeout(function(){
		i++;
　　　	var s= i%scope.pagedata.num;
		n=scope.pagedata.user[s].tel;
		
		$("#jqDeskText").text(n);
		if(scope.pagedata.stop==1){
			return;
		}
		scope.pagedata.init(i);
　　},100);
	
}
scope.pagedata.cj = function(){
	if(scope.pagedata.item.num<1 || scope.pagedata.item.num==undefined){
		alert('请选择抽奖人数');return;
	}
	$("#jqResultBox").empty();
	 $("#jqStart").attr("disabled", true);
	 $("#jqStart").addClass("hide");
     $("#jqEnd").removeAttr("disabled").removeClass("hide");
	 scope.pagedata.stop=0;	
	var params = {
					'plugin':'jy_h5game',
					'action':'post_data',
					'op':'sjh',
					'data':{
						num:scope.pagedata.item.num
					},
					'callback':function(data){
								 window.scope.pagedata.user=data.user;
								 window.scope.pagedata.num=data.num;
								  window.scope.pagedata.in=data.in;
								 scope.$apply();
							;
					}
		}
		scope.post_json(params);
		scope.pagedata.init(0);
		
}
scope.pagedata.end = function(){
	 $("#jqEnd").attr("disabled", true);
	 $("#jqEnd").addClass("hide");
     $("#jqStart").removeAttr("disabled").removeClass("hide");
		scope.pagedata.do(0);
}
scope.pagedata.do = function(i){
	n=scope.pagedata.in.length;
    if(!i){i=0}
	if(i==n){
		scope.pagedata.stop=1;
		scope.$apply();
		n=scope.pagedata.in[n-1].tel;
		$("#jqDeskText").text(n);
		return;
		}
	setTimeout(function(){
		num=scope.pagedata.in[i].tel;
		i++;
　　　	var liHtml = '<li>' + num + '</li>';
		$("#jqResultBox").prepend(liHtml);
		scope.pagedata.do(i);
　　},1000);
	
}
</script>